﻿#region Apache 2.0 License header

//   Copyright 2012 Lesley van Zijl
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License. 

#endregion

using System;
using System.Reflection;
using System.Text;
using FavourObjects;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Tests.Helpers;

namespace Tests
{
    [TestClass]
    public class ValidatorTests
    {
        [TestMethod]
        public void TestMethod1()
        {
            FavourInterfaceValidator.Validate(typeof (IWorkingInterface), typeof (TargetTestClass));
        }

        [TestMethod]
        public void TestMethod2()
        {
            try
            {
                FavourInterfaceValidator.Validate(typeof (IFormatProvider), typeof (StringBuilder));
                Assert.Fail();
            }
            catch (Exception)
            {
            }
        }

        #region Nested type: INestedInterface

        public interface INestedInterface
        {
            void Method2ParameterValueType(int i, float f);
        }

        #endregion

        #region Nested type: IWorkingInterface

        public interface IWorkingInterface : INestedInterface
        {
            int PropertyStaticValueTypeGetSet { get; set; }
            MethodInfo PropertyStaticReferenceTypeGetSet { get; set; }

            MethodInfo PropertyReferenceTypeGetSet { get; set; }
            int PropertyValueTypeGetSet { get; set; }

            int _fieldValueType { get; set; }
            void MethodOverload(int i);
            void MethodOverload(int i, double d);
            void MethodOverload(int i, MethodInfo mi);

            void RefArgValueTypeMethodUInt64(ref UInt64 number);
            void OutAndRefArgMethod(ref MethodInfo miRef, out MethodInfo miOut);
            void ParamsValueArgMethod(params int[] p);
        }

        #endregion
    }
}